package com.webank.wedatasphere.linkis.metadata.util;

import com.webank.wedatasphere.linkis.metadata.service.DataSourceTypeService;

import java.util.Map;

/**
 * @ClassName: DbServiceTypeFactory
 * @Description: 描述:创建实例化不同数据库对象的工厂
 * @author: zys
 * @date: 2021/3/3  14:06
 */
public class DbServiceTypeFactory {
    private Map<String,DataSourceTypeService> dbType;
    public DataSourceTypeService createDbService(String dbType){
        //不传参的话返回hive的服务
        return this.dbType.getOrDefault(dbType,this.dbType.get("hive"));
    }
    public void setDbType(Map<String, DataSourceTypeService> dbType) {
        this.dbType = dbType;
    }
}
